<!DOCTYPE html>
<html lang="zh-cmn-Hans">

<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
	<meta name="format-detection" content="telephone=no, date=no, address=no, email=no, url=no">
	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
	<meta http-equiv="Pragma" content="no-cache">
	<meta http-equiv="Expires" content="0">
	<title>存货清点</title>
	<meta name="description" content="">	
	<script type="text/javascript">
		(function (win, doc) {
			if (!win.addEventListener) return;
			var html = document.documentElement;
			function setFont() {
				var cliWidth = html.clientWidth;
				html.style.fontSize = 100 * (cliWidth / 750) + 'px';
			}
			win.addEventListener('resize', setFont, false);
			setFont();
		})(window, document);
	</script>
	<link rel="stylesheet" href="__WECHATCSS__/admin/css/main.css?201812202315">
</head>

<body>
	<div class="header">
        <img class="wecharHead" src="{$member_info.headimgurl}" />
        <h2>您好，{$member_info.nickname}</h2>
        <h3>所属门店：{$storeAdminInfo.store_name}</h3>
		<h3>金额：￥{$saAccountInfo.paied_amount}</h3>
        <p>
			<span>库存：</span>
			{volist name='goodsStoreList' id='item'}
				<span>{$item.goods_name}：{$item.store_count}</span>				
			{/volist}
		</p> 
		<p>
			<span>已借出：</span>
			{volist name='goodsStoreList' id='item'}
			{if condition="$item.sale_mode == 1 || $item.sale_mode == 2 "}
				<span>{$item.goods_name}：{$item.hire_sum}</span>	
			{/if}			
			{/volist}
		</p>
		<p>
			<span>已卖出：</span>
			{volist name='goodsStoreList' id='item'}
			{if condition="$item.sale_mode == 0 || $item.sale_mode == 2 "}
				<span>{$item.goods_name}：{$item.sales_sum}</span>		
			{/if}						
			{/volist}
		</p>
    </div>
	<div class="content">
		<ul class="returnList">
			{volist name="orderList" id="v"}				
            <li>
                <p>订单时间:{$v['add_time']|date="Y-m-d H:i:s",###}</p>
				<p>订单编号:{$v.order_sn}</p>
				<p>金额:￥{$v.total_amount}</p>
				<p>类型:{if condition="$v.order_mode eq 1"}租借{else/}购买{/if}</p>
				{if condition="$v.order_status lt 0"}
				{switch $v.order_status }
				{case value="-1" break="1"}<span class="set ed">已取消</span>{/case}
				{/switch}
				{else/}
				{if condition="$v.order_mode eq 1"}
				{if condition="$v.order_status eq 4 and $v.end_time lt time()"}
				<span class="set ing">已超时</span>
				{else/}				
					<span class="set ed">{$order_status[$v.order_status]}</span>
				{/if}
				{else/}				
					<span class="set ed">{$order_status[$v.order_status]}</span>
				{/if}
				{/if}
            </li>            
			{/volist}
        </ul>
		<span class="loadMore" data-page="1" data-url="/index.php/wechat/store_admin/store_manager.html?page=">加载更多</span>
	</div>
	<script src="__WECHATASSETS__/jquery.min.js"></script>
	<script>		
		if($('.returnList li').length<10){
			$('.loadMore').remove();
		}
		$('.loadMore').on('touchstart',function(){
			var nextPage=parseInt($(this).attr('data-page'))+1,url=$(this).attr('data-url');
			$.ajax({
				url: url+nextPage,
				cache: false,
				success: function (data){
					var dom = $('<div>').append(data);
                    var $list = dom.find('.returnList');
					if($list.find('li').length>0){
						$('.returnList').append($list.html());
						if($list.find('li').length<10){
							$('.loadMore').remove();
						}else{
							$('.loadMore').attr('data-page',nextPage);
						}
					}else{
						$('.loadMore').remove();
					}
				}
			});
		});
	</script>
</body>

</html>